import React from 'react';
import { Card, Descriptions } from 'antd';

export default class VoltageDataTab extends React.Component<any, any> {
  render() {
    const { energyStorageTotal, energyStorageVoList } = this.props;

    const energyStorageVo = energyStorageVoList
      ? energyStorageVoList.map((item, index) => {
          return (
            <Descriptions
              bordered
              size="small"
              style={{ padding: 0, marginTop: 20, fontWeight: 'normal' }}
              title={`${index + 1}可充电储能子系统电压信息`}
              key={index}
            >
              <Descriptions.Item label="可充电储能子系统号">
                {item.energyStorageSystemNum}
              </Descriptions.Item>
              <Descriptions.Item label="可充电储能装置电压(V)">
                {item.voltage ? `${item.voltage}` : ''}
              </Descriptions.Item>
              <Descriptions.Item label="可充电储能装置电流(A)">
                {item.current ? `${item.current}` : ''}
              </Descriptions.Item>
              <Descriptions.Item label="单体电池总数">{item.batteryTotal}</Descriptions.Item>
              <Descriptions.Item label="本帧起始电池序号">
                {}
                {/* {item.batteryVoltageNo} */}
              </Descriptions.Item>
              <Descriptions.Item label="本帧单体电池总数">
                {}
                {/* {item.batteryVoltageNum} */}
              </Descriptions.Item>
              {item.batteryVoltageList?.map((item2, index2) => {
                return (
                  <Descriptions.Item label={`单体电池${index2 + 1}电压(V)`} key={index2}>
                    {item2 ? `${item2}` : ''}
                  </Descriptions.Item>
                );
              })}

              {/* <Descriptions.Item label="单体电池1电压">123</Descriptions.Item>
              <Descriptions.Item label="单体电池2电压">123</Descriptions.Item>
              <Descriptions.Item label="单体电池3电压">12</Descriptions.Item> */}
            </Descriptions>
          );
        })
      : '';
    return (
      <>
        <Descriptions bordered size="small">
          <Descriptions.Item label="可充电储能子系统个数" span={1}>
            {energyStorageTotal}
          </Descriptions.Item>
        </Descriptions>
        {energyStorageVo}
      </>
    );
  }
}
